package com.starblink.preferenceconfig.view

import android.content.Context
import android.util.AttributeSet
import android.view.LayoutInflater
import android.widget.FrameLayout
import android.widget.ImageView.ScaleType
import com.starblink.android.basic.ext.gone
import com.starblink.android.basic.ext.visible
import com.starblink.basic.ext.load
import com.starblink.basic.style.R
import com.starblink.basic.util.CommUtils
import com.starblink.preferenceconfig.databinding.ViewCircleLogo1Binding

/**
 * 选择完成，品牌Logo视图
 */
class CircleLogoView1 @JvmOverloads constructor(
    context: Context,
    attrSet: AttributeSet?,
    defStyleAttr: Int = 0,
) : FrameLayout(context, attrSet, defStyleAttr) {

    private val binding: ViewCircleLogo1Binding
    private val avatar = R.drawable.icon_store_default_big

    init {
        binding = ViewCircleLogo1Binding.inflate(LayoutInflater.from(context), this, true)
    }

    fun load(
        url: String?,
        website: String?
    ) {
        binding.ivStore.load(url, placeholder = CommUtils.getDrawable(avatar), error = CommUtils.getDrawable(avatar))
    }
}